/*
function yuan(id, x, y){
	$('.circle.'+id).circleProgress({
		id: id,
		value: x
	}).on('circle-animation-progress', function(event, progress) {
		$(this).find('strong').html(parseInt(y * progress) + '<i>%</i>');
	});
}
/*
function yuan(id, num){
	var obj = $('#'+id).radialIndicator({
		barWidth:3,
		radius:20,
        barColor: {
            0: '#33CC33',
			99: '#33CC33',
            100: '#FF0000'
        },
		percentage: true
	}).data('radialIndicator');
	obj.animate(num);
}*/
function box(id, data){
	var object = document.getElementById(id);
	var i = 0;
	setInterval(function(){
		i++;
		if(i>data){
			i=data;
		}
		var imgLeft = -(i*44+(i*10))+'px';
		object.style.backgroundPosition = imgLeft+'\t'+'0px';
		object.innerHTML = i+'%';
	},10);
}
function SetHome(obj,vrl){
    try{
        obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
    }
    catch(e){
        if(window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage',vrl);
        }else{
            alert("您的浏览器不支持，请按照下面步骤操作：1.打开浏览器设置。2.点击设置网页。3.输入："+vrl+"点击确定。");
        }
    }
}

function set_login_credict(id){
	var userdata = "user_id="+id;
	$.ajax({
		type: "post",
		url: "/user/setlogincredict",
		data: userdata,
		success: function(msg){
			if(msg == 1) {
				alert("签到成功");
			} else if(msg == 2) {
				alert("已签到");
			} else {
				window.location = "/login/index.html";
			}
		}
	});
	return false;
}

$(function () {
	$(".float li").hover(function () {
		$(this).addClass("gxunc");
	}, function () {
		$(this).removeClass("gxunc");
	})

	$(".float .l4").hide();
	$(".float .b4").click(function () {
		$('body,html').animate({ scrollTop: 0 }, 500);
	})
});

$(window).scroll(function (e) {
	lk = location.pathname;
	if ($(this).scrollTop() >= 10) {
		$(".float .l4").show();
	} else {
		$(".float .l4").hide();
	}
});

function setFtype(v){
	document.getElementById('sftype').value=v;
	document.getElementById('bform').submit();
}
function setAccount(v){
	document.getElementById('saccount').value=v;
	document.getElementById('bform').submit();
}
function setApr(v){
	document.getElementById('sapr').value=v;
	document.getElementById('bform').submit();
}
function setLimit(v){
	document.getElementById('slimit').value=v;
	document.getElementById('bform').submit();
}
function setRate(v){
	document.getElementById('srate').value=v;
	document.getElementById('bform').submit();
}
function setOrder(v){
	document.getElementById('sorder').value=v;
	document.getElementById('bform').submit();
}

function changeImage() {
	document.getElementById("imgCode").src = "/yanzheng/index/?" + Math.random();
}
function changeImage1() {
	document.getElementById("imgCode1").src = "/yanzheng/index/?" + Math.random();
}